
	<h2>Products</h2>	
	<div class="productlist">
		<?php
			if(count($item_arr) > 0)
			{
		?>
		<div class="products">
			<?php //print_r($item_arr);
				foreach ($item_arr as $item_entry) :
			?>
			<form name="frmProductDetails" method="POST" action="<?php echo SITEURL; ?>index.php/?addtocart">
			<div class="product">
				<div class="mblock clearfix inner">
					<div class="lblock pimage">
						<?php
                      $filePath= DOCROOT."images/products/thumbs/". $item_entry['filename'];

                     if(file_exists($filePath))
                     {
					?>
                     <img src="<?php echo SITEURL; ?>images/products/thumbs/<?php echo $item_entry['filename']; ?>" border="0" alt="<?php echo $item_entry['product_title']; ?>" width="100" height="100" />
					<?php
                     }
                      else { ?>
                       <img src="<?php echo SITEURL; ?>images/products/thumbs/NoImage.jpg" border="0" alt="<?php echo $item_entry['product_title']; ?>" width="100" height="100" />
                   <?php } ?>
					</div>
					<div class="rblock actions">
						<a href="<?php echo SITEURL; ?>index.php/?details/<?php echo $item_entry['productid']; ?>" class="details">Details</a>
						<div class="quadd">
							<label>Quantity :</label><input type="text" name="txtQty" id="txtQty" value="1" maxlength="5" size="2" onkeyup="validateQty('<?php echo $item_entry['productid']; ?>')" class="qinp" />
							<input type="submit" name="btnAddCart" value="Add to Basket" class="add" />
							<input type="hidden" name="productid" id="productid" value="<?php echo $item_entry['productid']; ?>" />
    <input type="hidden" name="price" id="price" value="<?php echo $item_entry['product_price_lkr']; ?>" />
						</div>
					</div>
					<div class="rblock prices">
						Only : 
						<div class="formatedPrice">
                           <?php 
								if(!empty($item_entry['discount']))
								{
							?>
								<s>LKR <?php echo number_format($item_entry['product_price_lkr'], 2, '.', ','); ?></s> LKR <?php echo number_format($item_entry['discount'], 2, '.', ','); ?>
							<?php 	
								} else {
									echo "LKR " . number_format($item_entry['product_price_lkr'], 2, '.', ','); 
								}
							?>
                       </div>
					</div>
					<div class="cblock desc">
						<div class="title"><a href="<?php echo SITEURL; ?>index.php/?details/<?php echo $item_entry['productid']; ?>"><?php echo $item_entry['product_title']; ?></a></div>
						<div class="webid">Item Number : <?php echo $item_entry['item_code']; ?></div>
						<div class="shortdesc"><?php echo $item_entry['product_dsc_en']; ?></div>
					</div>
				</div>
			</div>
			</form>
			<?php 
				endforeach;
			?>
		</div>
		<?php
			} else {
				echo "Sorry. No items found under this category";
			}
		?>			
		
	</div>
	